package firstdemo;

import java.io.File;

public class Del {
	public static void main(String[] args) {
		File fs=new File("d:\\aa");
		DelFile(fs);
	}

	private static void DelFile(File fs) {
		File[] files=fs.listFiles();
		if(files.length>0)
		{
			for (File file : files) {
				if(file.isDirectory()){
					DelFile(file);
				}
				else{
					file.delete();
					System.out.println(file.delete()+"  deleted");
				}
			}
		}
		fs.delete();
		System.out.println(fs.getName()+"   deleted...");
	}
}
